package data.platform.common.stream.valueobjects;

public enum AggregatorFunctionType {
    SUM("总和"),
    AVG("平均值"),
    MIN("最小值"),
    MAX("最大值"),
    COUNT("次数");

    private String name;

    AggregatorFunctionType(String name) {
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public static AggregatorFunctionType fromString(String name) {
        for (AggregatorFunctionType b : AggregatorFunctionType.values()) {
            if (b.name.equals(name)) {
                return b;
            }
        }
        return null;
    }
}
